#include <stdio.h>
#include "msTree.h"
#include <stdio.h>

TNode* createTree(int* pre,int* in,int n)
{
	if(n==0)
		return 0;
	TNode* root=new TNode;
	root->data=pre[0];
	root->lch=root->rch=0;
	
	int ind=0;
	while(in[ind]!=pre[0])
	{
		ind++;
	}
	root->lch=createTree(pre+1,in,ind);
	root->rch=createTree(pre+1+ind,in+ind+1,n-ind-1);
		
		
	return root;
}
void printTree(TNode* root)
{
	if(root!=0)
	{
		printf("%d(",root->data);
		printTree(root->lch);
		printf(",");
		printTree(root->rch);
		printf(")");
	}
}
